package com.iocup.keybastion.authorize;



import com.iocup.keybastion.utils.AuthUtils;

import java.util.Set;

/**
 * @author xyjxust
 * @create 2022/3/8 9:33
 **/
public class DefaultHasAuthorizationProvider  implements HasAuthorizationProvider{


    @Override
    public Set<String> getPermissions(String loginName, String device) {
        return AuthUtils.isLogin()?AuthUtils.getUserInfo().getPermissions():null;
    }

    @Override
    public Set<String> getRoles(String loginName, String device) {
        return AuthUtils.isLogin()?AuthUtils.getUserInfo().getRoles():null;
    }
}
